#pragma once

#include "datatypedefine.h"
#include "deviceactor.h"
#include <osg\ref_ptr>
#include <QList>
#include <QMap>

namespace VrDataCore
{
	class Map;

	class VRDATACORE_EXPORT DeviceGroup:public DeviceActor
	{
	public:
		DeviceGroup();
		virtual void addChild(CoreBase::ActorBase* mactor);
		virtual void removeChild(CoreBase::ActorBase* mactor);
		virtual void addChild(QVector<CoreBase::ActorBase*> mactors);
		virtual void removeChild(QVector<CoreBase::ActorBase*> mactors);
		virtual void getAllChildren(QList<CoreBase::ActorBase*>& returnval,const QString& classname,
			bool isinstanceof = true,bool findchild = false);
		virtual void clearAllChildren(const QString& classname = "",bool isinstanceof = false);
		virtual void getAllChildren(QList<osg::ref_ptr<CoreBase::ActorBase>>& returnval,const QString& classname,
			bool isinstanceof = true,bool findchild = false){}
		virtual void onMapLoadBegin(CoreBase::Map*){}
		virtual void onMapLoadEnd(CoreBase::Map*);
		virtual CoreBase::ActorBase* getActorById(const QString& id,const QString& classname,bool isinstanceof,bool findchild);
		virtual void getAllObjects(const QString& classname,bool isinstanceof,QVector<CoreBase::ActorBase*>& returnvector);
	protected:
		~DeviceGroup();
		QMap<QString,CoreBase::ActorBase*>								_allChild;
	};
}